package com.wl.utils;

/**
 * @author lb
 * @date 2018/4/17 19:29
 */
public class PageUtil {

    private int pageSize;
    private int currentPage;
    private int totalPage;
    private int indexPage;

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getIndexPage() {
        return indexPage;
    }

    public void setIndexPage(int indexPage) {
        this.indexPage = indexPage;
    }

    //总页数
    public void getPageCount(int countTotal) {
        int size = countTotal/pageSize;
        int mod = countTotal % pageSize;
        if(mod != 0){
            this.totalPage = ++size;
        } else {
            this.totalPage = size;
        }
    }
}
